home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr52 / expand53.zip / XPDEMO.ZIP / XPEGAVGA.PRG < prev    next >
Text File  |  1992-08-07  |  2KB  |  69 lines

  1. * ------------------------------------------------------------------------
  2. * Module......:    XPEGAVGA.PRG
  3. * Title.......: EGA/VGA part of the Expand Library Demonstration Program
  4. * Author......:    Pepijn Smits.
  5. * Date........:    July/August 1992
  6. * Copyright...:    (c)1992 by Softwarebureau Pepijn Smits
  7. * Notes.......:    Clipper 5.01 Demo of the Expand Library
  8. *        Some general EGA/VGA functions
  9. *        See XPDEMO.RMK For Compile and Link instructions.
  10. * ------------------------------------------------------------------------
  11. #include "..\EXPAND.CH"
  12. #include "INKEY.CH"
  13.  
  14. Function EGAtest()
  15. Local lEga := XPegaThere()
  16. if !lEga
  17.     XPalert('~EGA/VGA~ required',;
  18.         'This option requires that you have a ~EGA/VGA~ card installed!')
  19. end
  20. Return (lEGA)
  21.  
  22. Function FontStd()
  23. if EGAtest()
  24.     if XPvgaThere()
  25.         XPvgaStdFont()
  26.     else
  27.         XPegaStdFont()
  28.     end
  29. end
  30. Return (NIL)
  31.  
  32. Function FontTest()
  33. Field FONTNAME, FONTINFO, FONTDATA
  34. if EGAtest()
  35.     if FontUsed()
  36.         XPmsg(' Load ~Font~ │ Select Font. ~Enter~-Loads, ~Esc~-Aborts')
  37.         XPedit(' ~EGA/VGA~ Fonts',;
  38.             '  Font:       Info:',{||'  '+FONTNAME+'  '+FONTINFO+'                 '},;
  39.             {|i|DoFont(i)})
  40.         USE
  41.     else
  42.         XPalert("Font File not Found!",;
  43.             "The File ~VGAFONTS.DBF~ or ~EGAFONTS.DBF~ was not found!;"+;
  44.             "You must place this file (according if you have an EGA or a VGA;"+;
  45.             "in the directory where XPDEMO.EXE is located in order to use;"+;
  46.             "The font load part of this Demo program.")
  47.     end
  48. end
  49. Return (NIL)
  50.  
  51. Static Function FontUsed()
  52. Local lRet := .f.
  53. Local cFontFile := if(XPvgaThere(),"VGAFONTS.DBF","EGAFONTS.DBF")
  54. if file(MyDrive()+cFontFile)
  55.     USE (MyDrive()+cFontFile) NEW READONLY
  56.     lRet := Used()
  57. end
  58. Return (lRet)
  59.     
  60. Static Function DoFont(i)
  61. Field FONTDATA
  62. if Lastkey()=K_ENTER
  63.     XPloadFont(0,FONTDATA,if(XPvgaThere(),16,14))
  64.     i := K_SPACE
  65. else
  66.     i := Lastkey()
  67. end
  68. Return (i)
  69.